
$(document).ready(function(){
	findAll();
});

function configUpdate(){
	var whitebarone = $('#whitebarone').val();
	var whitebartwo = $('#whitebartwo').val();
	var whitebarthree = $('#whitebarthree').val();
	var whitebarpercentone = $('#whitebarpercentone').val();
	var whitebarpercenttwo = $('#whitebarpercenttwo ').val();
	var whitebarpercentthree = $('#whitebarpercentthree').val();
	var whitebarNeedPayMoney = $('#whitebarNeedPayMoney').val();
	var withdrawmoney = $('#withdrawmoney').val();
	var netAge = $('#netAge').val();
	var contactPhoneNum = $('#contactPhoneNum').val();
	var billFee = $('#billFee').val();
	var listincontacttop10Num = $('#listincontacttop10Num').val();
	var contactLimit = $('#contactLimit').val();
	alert(contactLimit);

	$.ajax({
		url: urlcore + "/api/dictionaryData/updateAll",
		type: "post",
		dataType: 'json',
		contentType: "application/json;charset=utf-8",
		data:JSON.stringify({
            "whitebarpercentone": whitebarpercentone,
            "whitebarpercenttwo": whitebarpercenttwo,
            "whitebarpercentthree": whitebarpercentthree,
            "whitebarone": whitebarone,
            "whitebartwo":whitebartwo,
            "whitebarthree": whitebarthree,
            "whitebarNeedPayMoney": whitebarNeedPayMoney,
            "withdrawmoney": withdrawmoney,
            "netAge": netAge,
            "contactPhoneNum":contactPhoneNum,
            "billFee": billFee,
            "listincontacttop10Num": listincontacttop10Num,
            "contactLimit": contactLimit
        }),
		success:function(data){
			alert("保存成功",true);
			location.reload();
		},
		error:function() {
			alert("error");
		}
	});
}

function findAll(){
	$.ajax({ 
		url: urlcore + "/api/dictionaryData/selectAll",
		type: "get",
		dataType: 'json',
		contentType: "application/json;charset=utf-8",
		success:function(data){
			$.each(data.data, function(i,n) {
				var name = n.dictName;
				var val = n.dictdataValue;
				$('#'+name).val(val);
			});
		},
		error:function() {
			alert("error");
		}
	});
}